#!/bin/bash

# MongoDB 连接信息
MONGO_URI="mongodb://localhost:27017/chembox"

# 要导出的集合列表
COLLECTIONS=("bottles" "designers" "dictionarylabels" "dictionaryvalues" "exptables" "languages" "reactions" "reagents" "shelves" "userreagents" "users" "workbenches")

# 循环导出每个集合
for COLLECTION in "${COLLECTIONS[@]}"
do
    mongoexport --uri="$MONGO_URI" --collection="$COLLECTION" --out="$COLLECTION.json" --jsonArray
    echo "Exported $COLLECTION to $COLLECTION.json"
done